<template>
  <div>
    <h1>Home</h1>
    <div>
      <router-link to="/home/music">
        <button>music</button>
      </router-link>
      <router-link to="/home/news">
        <button>news</button>
      </router-link>

    </div>
    <!-- 动态组件 :is="Component"   通过作用域插槽传过来的-->
    <router-view v-slot="{Component}">
      <keep-alive>
        <component :is="Component" /> 
      </keep-alive>
    </router-view>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "Home",
});

</script>

<script setup lang="ts">

</script>

<style scoped>

</style>